From 92e87e40a7525cd84579865bf7404a84bde93115 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sat, 23 Jun 2001 20:26:10 +0000 Subject: [PATCH] disabled g_free (image) calls, as GdkImage is an object. these should be Sat Jun 23 22:03:20 2001 Tim Janik * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) calls, as GdkImage is an object. these should be g_obejct_unref() instead but that won't work because of the g_error() statement in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ to spot these places. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gdk/x11/gdkimage-x11.c | 23 ++++++++++++----------- 8 files changed, 68 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 094419983f..792da488df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 094419983f..792da488df 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Sat Jun 23 22:03:20 2001 Tim Janik + + * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image) + calls, as GdkImage is an object. these should be g_obejct_unref() + instead but that won't work because of the g_error() statement + in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/ + to spot these places. + Sat Jun 23 10:27:53 2001 Owen Taylor * modules/input/gtkimcontextxim.c: Fixup some problems with diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c index eb116f7488..008b515bc7 100644 --- a/gdk/x11/gdkimage-x11.c +++ b/gdk/x11/gdkimage-x11.c @@ -55,13 +55,15 @@ static GList *image_list = NULL; static gpointer parent_class = NULL; -static void gdk_x11_image_destroy (GdkImage *image); -static void gdk_image_init (GdkImage *image); -static void gdk_image_class_init (GdkImageClass *klass); -static void gdk_image_finalize (GObject *object); +static void gdk_x11_image_destroy (GdkImage *image); +static void gdk_image_init (GdkImage *image); +static void gdk_image_class_init (GdkImageClass *klass); +static void gdk_image_finalize (GObject *object); #define PRIVATE_DATA(image) ((GdkImagePrivateX11 *) GDK_IMAGE (image)->windowing_data) +#define LEAK_IMAGE(image) /* FIXME!! this should be g_object_unref */ + GType gdk_image_get_type (void) { @@ -94,7 +96,6 @@ static void gdk_image_init (GdkImage *image) { image->windowing_data = g_new0 (GdkImagePrivateX11, 1); - } static void @@ -249,7 +250,7 @@ gdk_image_new (GdkImageType type, { g_warning ("XShmCreateImage failed"); - g_free (image); + LEAK_IMAGE (image); gdk_use_xshm = False; return NULL; } @@ -273,7 +274,7 @@ gdk_image_new (GdkImageType type, XDestroyImage (private->ximage); g_free (private->x_shm_info); - g_free (image); + LEAK_IMAGE (image); return NULL; } @@ -290,7 +291,7 @@ gdk_image_new (GdkImageType type, shmctl (x_shm_info->shmid, IPC_RMID, 0); g_free (private->x_shm_info); - g_free (image); + LEAK_IMAGE (image); /* Failure in shmat is almost certainly permanent. Most likely error is * EMFILE, which would mean that we've exceeded the per-process @@ -314,7 +315,7 @@ gdk_image_new (GdkImageType type, shmctl (x_shm_info->shmid, IPC_RMID, 0); g_free (private->x_shm_info); - g_free (image); + LEAK_IMAGE (image); gdk_use_xshm = False; @@ -334,12 +335,12 @@ gdk_image_new (GdkImageType type, } else { - g_free (image); + LEAK_IMAGE (image); return NULL; } break; #else /* USE_SHM */ - g_free (image); + LEAK_IMAGE (image); return NULL; #endif /* USE_SHM */ case GDK_IMAGE_NORMAL: -- 2.30.2